package login

import (
	"admissionsystem/models"
	"admissionsystem/pkg/app"

	//"strings"

	"github.com/gin-gonic/gin"
)

func GetLogin(c *gin.Context) {
	var logindata models.Login
	c.ShouldBind(&logindata)
	err, info := models.GetLogin(logindata.Username)
	if err != nil {
		app.PswError(c, info, "数据库查无此用户")
		return
	}
	if logindata.Password== info.Password {
	app.OK(c, info, "登陆成功")
	} else {
	app.PswError(c, info, "登录失败")
	return
	}
}
